<!DOCTYPE html>
<html>
<head th:include="common/header_css::header('霸王餐小程序后台管理-商品信息','%mfile%datepicker%summernote')"></head>
<!--<head th:include="common/header_css::header('霸王餐小程序后台管理-订单管理')"></head>-->
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div th:replace="common/toolbar::toolbar('订单信息管理')"></div>
        <div th:replace="common/search::search('%order%qtype')"></div>
    </div>
</div>

<!--添加Order模态框-->
<div id="modal-add-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">订单添加</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="aform" method="post" class="form-horizontal" action="add"
                                      onsubmit="return checkAdd()">

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品ID</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="gid"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单编号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="orderNo"
                                                           type="text" maxlength="30"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">退款编号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="refundNo"
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">优惠券编号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="couponId"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">运单号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="shipperCode"
                                                           type="text" maxlength="255"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">货运公司</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="shipperName"
                                                           type="text" maxlength="255"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">收货地址 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="address"
                                                           required
                                                           type="text" maxlength="500"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">联系人 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="linkman"
                                                           required
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">联系电话 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="phone"
                                                           required
                                                           type="number" phone maxlength="11"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">支付方式 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="payType">
                                                        <option value="1">货到付款</option>
                                                        <option value="2">微信支付</option>
                                                        <option value="3">余额支付</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">过期时间(分) *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="expire"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>


                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品名 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="goodsName"
                                                           required type="text" maxlength="500"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品规格</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="spec" type="text" maxlength="500"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品标价*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="price"
                                                           required type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">实际售价*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="saleprice" required type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">不含运费总价（不包含运费的价格） *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="prices"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">运费*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="yunfei"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单总价 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="total"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">活动优惠</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="activityDiscount"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">会员折扣</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="memberDiscount"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">优惠券折扣</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="couponDiscount"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">积分抵扣金额</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="jifenDiscount"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">抵扣积分</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="jifen"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">营销事件</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="meid"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">会员余额抵扣</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="deduction"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">优惠折扣</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="discount"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">实付金额 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="realpay"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否需要物流信息 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="isNeedLogistics"
                                                           value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">预约时间
                                                    *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="date" class="form-control selectData" readonly
                                                           id="yytime" name="yytime">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">实体店ID
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="sid"
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单状态 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="status">
                                                        <option value="-1">已关闭</option>
                                                        <option value="0">已取消</option>
                                                        <option value="1">待支付</option>
                                                        <option value="2">待发货</option>
                                                        <option value="3">待收货</option>
                                                        <option value="4">已取消</option>
                                                        <option value="5">已完成</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">禁用状态 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="state" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单购买类型 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="orderType">
                                                        <option value="0">默认</option>
                                                        <option value="1">拼团</option>
                                                        <option value="2">抽奖</option>
                                                        <option value="4">砍价</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">产品类型 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="gtype">
                                                        <option value="1">实物产品</option>
                                                        <option value="2">虚拟产品</option>
                                                        <option value="3">预约到店服务</option>
                                                        <option value="4">预约上门服务</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">物流跟踪</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="traces"
                                                           type="text" maxlength="1000"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品总数量 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="goodsNumber"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">服务码</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="serviceCode"
                                                           type="text" maxlength="30"/>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否评论</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="isComment"
                                                           value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="row">
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">买单类型 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="type">
                                                        <option value="0">默认</option>
                                                        <option value="0">自己买单</option>
                                                        <option value="2">他人买单</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">商品图 *
                                                </label>
                                                <div class="col-sm-10">
                                                    <input id="mfile" name="mfile" type="file" class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">下单备注信息 *
                                                </label>
                                                <div class="col-sm-10">
                                                            <textarea class="form-control" name="remark" maxlength="500"
                                                                      required></textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-add-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="hidpic" name="pic" type="hidden" value=""
                                           required="required"/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--修改Order模态框-->
<div id="modal-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">订单修改</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="mform" method="post" class="form-horizontal" action="modify"
                                      onsubmit="return checkModify()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品ID</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="gid" name="gid"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单编号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="orderNo" name="orderNo"
                                                           type="text" maxlength="30"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">退款编号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="refundNo" name="refundNo"
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">优惠券编号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="couponId" name="couponId"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">运单号</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="shipperCode" name="shipperCode"
                                                           type="text" maxlength="255"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">货运公司</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="shipperName" name="shipperName"
                                                           type="text" maxlength="255"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">收货地址 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="address" name="address"
                                                           required
                                                           type="text" maxlength="500"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">联系人 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="linkman" name="linkman"
                                                           required
                                                           type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">联系电话 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="phone" name="phone"
                                                           required
                                                           type="number" phone maxlength="11"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">支付方式 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="payType" id="payType">
                                                        <option value="1">货到付款</option>
                                                        <option value="2">微信支付</option>
                                                        <option value="3">余额支付</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">过期时间(分) *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="expire" name="expire"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品名 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="goodsName" name="goodsName"
                                                           required
                                                           type="text" maxlength="500"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品规格</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="spec" name="spec"
                                                           type="text" maxlength="500"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品标价 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="price" name="price"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">实际售价 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="saleprice" name="saleprice"
                                                           required type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">不含运费总价（不包含运费的价格） *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="prices" name="prices"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">运费 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="yunfei" name="yunfei"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单总价 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="total" name="total"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">活动优惠</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="activityDiscount"
                                                           name="activityDiscount"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">会员折扣</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="memberDiscount"
                                                           name="memberDiscount"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">优惠券折扣</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="couponDiscount"
                                                           name="couponDiscount"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">积分抵扣金额</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="jifenDiscount" name="jifenDiscount"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">抵扣积分</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="jifen" name="jifen"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">营销事件</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="meid" name="meid"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">会员余额抵扣</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="deduction" name="deduction"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">优惠折扣</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="discount" name="discount"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">实付金额 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="realpay" name="realpay"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否需要物流信息 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="isNeedLogistics" name="isNeedLogistics"
                                                           value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">实体店ID
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="sid" name="sid" type="text" maxlength="50"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">预约时间 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="text" class="form-control selectData" readonly
                                                           id="yytime2" name="yytime">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单状态 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="status" id="status">
                                                        <option value="-1">已关闭</option>
                                                        <option value="0">已取消</option>
                                                        <option value="1">待支付</option>
                                                        <option value="2">待发货</option>
                                                        <option value="3">待收货</option>
                                                        <option value="4">已取消</option>
                                                        <option value="5">已完成</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">禁用状态 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="state" name="state" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">订单购买类型 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="orderType" id="orderType">
                                                        <option value="0">默认</option>
                                                        <option value="1">拼团</option>
                                                        <option value="2">抽奖</option>
                                                        <option value="4">砍价</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">产品类型 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="gtype" id="gtype">
                                                        <option value="1">实物产品</option>
                                                        <option value="2">虚拟产品</option>
                                                        <option value="3">预约到店服务</option>
                                                        <option value="4">预约上门服务</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">物流跟踪</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="traces" name="traces"
                                                           type="text" maxlength="1000"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">商品总数量 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="goodsNumber" name="goodsNumber"
                                                           required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">服务码</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="serviceCode" name="serviceCode"
                                                           type="text" maxlength="30"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">是否评论</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="isComment" name="isComment" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">买单类型 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="type" id="type">
                                                        <option value="0">默认</option>
                                                        <option value="0">自己买单</option>
                                                        <option value="2">他人买单</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">商品图 *
                                                </label>
                                                <div class="col-sm-10">
                                                    <img id="previewPic" src='' class='file-preview-image' alt=''
                                                         title=''
                                                         style="width: 100px;height: 100px;"/>
                                                    <input id="mfile2" name="mfile" type="file" class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">下单备注信息 *
                                                </label>
                                                <div class="col-sm-10">
                                                            <textarea id="remark" name="remark" class="form-control"
                                                                      maxlength="500"
                                                                      required></textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="hidpic2" name="pic" type="hidden" value=""
                                           required="required"/>
                                    <input id="id" name="id" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--快递发货-->
<div id="kuaidi-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <div class="col-md-6">
                        <div class="input-group">
                            <div class="input-group-addon">配送方式</div>
                            <select class="form-control select2"  id="selectShipperMethod" name="shipperMethod" onchange="shipperChange(this.value)">
                                <option value="1">快递配送</option>
                                <option value="2">外卖配送</option>
                                <option value="3">自行配送</option>
                                <option value="4">自提</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-md-6">
                    </div>
                </div>
                <div class="row" id="shipperDiv">
                    <div class="col-md-6">
                        <div class="input-group">
                            <div class="input-group-addon">快递公司</div>
                            <select class="form-control select2"  id="selectShipperName" name="shipperName">
                                <option value="">请选择快递公司</option>
                                <option th:each="c:${kuaidis}" th:value="${c.code}" th:text="${c.name}"></option>
                            </select>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="input-group">
                            <div class="input-group-addon">运单号</div>
                            <input type="text" class="form-control" style="width:200px;text-align: center" id="txtShipperCode"
                                   name="shipperCode" placeholder="请录入运单号"/>
                        </div>
                    </div>
                </div>
                <div class="row" style="margin-top: 20px">
                    <div class="col-sm-4 col-sm-offset-2">
                        <button class="btn btn-primary" type="button" onclick="fahuo()">发货</button>
                        <button data-toggle="modal" type="button" class="btn btn-white" href="#kuaidi-form">取消</button>
                        <input id="hidid" name="id" type="hidden" value="" />
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<input id="isAdmin" type="hidden" th:value="${isAdmin}"/>
<div th:include="common/footer_js::footer"></div>
<script>

    //图片上传
    function sendFile(file, editor, $editable) {

        var filename = false;
        try {
            filename = file['name'];
        } catch (e) {
            filename = false;
        }
        if (!filename) {
            $(".note-alarm").remove();
        }
        //以上防止在图片在编辑器内拖拽引发第二次上传导致的提示错误
        data = new FormData();
        data.append("mfile", file);
        data.append("key", filename); //唯一性参数

        $.ajax({
            data: data,
            type: "POST",
            url: "/upload/file?type=sn_Order",
            cache: false,
            contentType: false,
            processData: false,
            success: function (e) {
                console.log(e)
                if (e && e.code != 0) {
                    swal({title: "上传失败", text: "", type: "error"})
                    return;
                } else {
                    swal({title: "上传成功", text: "", type: "success"})
                }
                editor.insertImage($editable, e.data);
                setTimeout(function () {
                    $(".note-alarm").remove();
                }, 5000);
            },
            error: function () {
                swal({title: "上传失败", text: "", type: "error"})
                return;
            }
        });
    }

    $(document).ready(function () {
        $(".summernote").summernote({
            lang: "zh-CN",
            width: 535,
            height: 260,
            dialogsInBody: true,
            onImageUpload: function (files, editor, $editable) {
                sendFile(files[0], editor, $editable);
            }
        })
    });
</script>
<script src="/js/admin/order.js"></script>
</body>
</html>
